package com.aabte.design2.structural.wrapper;

/**
 * 装饰组件的简单示例
 *
 * @author Daniel
 * @version 1.0
 * @date 2020/5/3
 */
public class Application {

    public static void main(String[] args) {
        Application application = new Application();
        application.dumbUsageExample();
    }

    public void dumbUsageExample() {
        DataSource dataSource = new FileDataSource();
        dataSource.writeData("test_data_1");

        System.out.println("--------------------");

        dataSource = new CompressionDecorator(dataSource);
        dataSource.writeData("test_data_2");

        System.out.println("--------------------");

        dataSource = new EncryptionDecorator(dataSource);
        dataSource.writeData("test_data_3");
    }

}
